Nightly Per-Antenna Quality Summary Notebook¶

Josh Dillon, Last Revised February 2021

This notebooks brings together as much information as possible from ant_metrics, auto_metrics and redcal to help figure out which antennas are working properly and summarizes it in a single giant table. It is meant to be lightweight and re-run as often as necessary over the night, so it can be run when any of those is done and then be updated when another one completes.

Contents:¶

  • Table 1: Overall Array Health
  • Table 2: RTP Per-Antenna Metrics Summary Table
  • Figure 1: Array Plot of Flags and A Priori Statuses
In [1]:
import os
os.environ['HDF5_USE_FILE_LOCKING'] = 'FALSE'
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import pandas as pd
pd.set_option('display.max_rows', 1000)
from hera_qm.metrics_io import load_metric_file
from hera_cal import utils, io, redcal
import glob
import h5py
from copy import deepcopy
from IPython.display import display, HTML
from hera_notebook_templates.utils import status_colors
from hera_mc import mc
from pyuvdata import UVData

%matplotlib inline
%config InlineBackend.figure_format = 'retina'
display(HTML("<style>.container { width:100% !important; }</style>"))
In [2]:
# If you want to run this notebook locally, copy the output of the next cell into the first few lines of this cell.

# JD = "2459122"
# data_path = '/lustre/aoc/projects/hera/H4C/2459122'
# ant_metrics_ext = ".ant_metrics.hdf5"
# redcal_ext = ".maybe_good.omni.calfits"
# nb_outdir = '/lustre/aoc/projects/hera/H4C/h4c_software/H4C_Notebooks/_rtp_summary_'
# good_statuses = "digital_ok,calibration_maintenance,calibration_triage,calibration_ok"
# os.environ["JULIANDATE"] = JD
# os.environ["DATA_PATH"] = data_path
# os.environ["ANT_METRICS_EXT"] = ant_metrics_ext
# os.environ["REDCAL_EXT"] = redcal_ext
# os.environ["NB_OUTDIR"] = nb_outdir
# os.environ["GOOD_STATUSES"] = good_statuses
In [3]:
# Use environment variables to figure out path to data
JD = os.environ['JULIANDATE']
data_path = os.environ['DATA_PATH']
ant_metrics_ext = os.environ['ANT_METRICS_EXT']
redcal_ext = os.environ['REDCAL_EXT']
nb_outdir = os.environ['NB_OUTDIR']
good_statuses = os.environ['GOOD_STATUSES']
print(f'JD = "{JD}"')
print(f'data_path = "{data_path}"')
print(f'ant_metrics_ext = "{ant_metrics_ext}"')
print(f'redcal_ext = "{redcal_ext}"')
print(f'nb_outdir = "{nb_outdir}"')
print(f'good_statuses = "{good_statuses}"')
JD = "2459878"
data_path = "/mnt/sn1/2459878"
ant_metrics_ext = ".ant_metrics.hdf5"
redcal_ext = ".known_good.omni.calfits"
nb_outdir = "/home/obs/src/H6C_Notebooks/_rtp_summary_"
good_statuses = "digital_ok,calibration_maintenance,calibration_triage,calibration_ok"
In [4]:
from astropy.time import Time, TimeDelta
utc = Time(JD, format='jd').datetime
print(f'Date: {utc.month}-{utc.day}-{utc.year}')
Date: 10-25-2022
In [5]:
# Per-season options
def ant_to_report_url(ant):
    return f'https://htmlpreview.github.io/?https://github.com/HERA-Team/H6C_Notebooks/blob/main/antenna_report/antenna_{ant}_report.html'

Load Auto Metrics¶

In [6]:
use_auto_metrics = False

# find the auto_metrics file
glob_str = os.path.join(data_path, f'zen.{JD}*.auto_metrics.h5')
auto_metrics_file = sorted(glob.glob(glob_str))

# if it exists, load and extract relevant information
if len(auto_metrics_file) > 0:
    auto_metrics_file = auto_metrics_file[0]
    print(f'Found auto_metrics results file at {auto_metrics_file}.')
    
    auto_metrics = load_metric_file(auto_metrics_file)
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
    auto_ex_ants = auto_metrics['ex_ants']['r2_ex_ants']
    
    use_auto_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping auto_metrics.')
Found auto_metrics results file at /mnt/sn1/2459878/zen.2459878.28306.sum.auto_metrics.h5.

Load Ant Metrics¶

In [7]:
use_ant_metrics = False

# get a list of all ant_metrics files
glob_str = os.path.join(data_path, f'zen.{JD}.?????.sum{ant_metrics_ext}')
ant_metrics_files = sorted(glob.glob(glob_str))

# if they exist, load as many of them as possible
if len(ant_metrics_files) > 0:
    print(f'Found {len(ant_metrics_files)} ant_metrics files matching glob {glob_str}')
    ant_metrics_apriori_exants = {}
    ant_metrics_xants_dict = {}
    ant_metrics_dead_ants_dict = {}
    ant_metrics_crossed_ants_dict = {}
    ant_metrics_dead_metrics = {}
    ant_metrics_crossed_metrics = {}
    dead_cuts = {}
    crossed_cuts = {}
    for amf in ant_metrics_files:
        with h5py.File(amf, "r") as infile: # use h5py directly since it's much faster than load_metric_file
            # get out results for this file
            dead_cuts[amf] = infile['Metrics']['dead_ant_cut'][()]
            crossed_cuts[amf] = infile['Metrics']['cross_pol_cut'][()]
            xants = infile['Metrics']['xants'][:]
            dead_ants = infile['Metrics']['dead_ants'][:]
            crossed_ants = infile['Metrics']['crossed_ants'][:]        
            try:
                # look for ex_ants in history
                ex_ants_string = infile['Header']['history'][()].decode()
                ex_ants_string = ex_ants_string.split('--apriori_xants')[1]
                ex_ants_string = ex_ants_string.split('--')[0].strip()
            except:
                ex_ants_string = ''
                    
            # This only works for the new correlation-matrix-based ant_metrics
            if 'corr' in infile['Metrics']['final_metrics'] and 'corrXPol' in infile['Metrics']['final_metrics']:
                ant_metrics_dead_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corr'][ant][()]
                                                 for ant in infile['Metrics']['final_metrics']['corr']}
                ant_metrics_crossed_metrics[amf] = {eval(ant): infile['Metrics']['final_metrics']['corrXPol'][ant][()]
                                                    for ant in infile['Metrics']['final_metrics']['corrXPol']}                       
            else:
                raise(KeywordError)
        
        # organize results by file
        ant_metrics_xants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in xants]
        ant_metrics_dead_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in dead_ants]
        ant_metrics_crossed_ants_dict[amf] = [(int(ant[0]), ant[1].decode()) for ant in crossed_ants]
        ant_metrics_apriori_exants[amf] = [int(ant) for ant in ex_ants_string.split()]
    
    dead_cut = np.median(list(dead_cuts.values()))
    crossed_cut = np.median(list(crossed_cuts.values()))
        
    use_ant_metrics = True
else:
    print(f'No files found matching glob {glob_str}. Skipping ant_metrics.')
Found 1714 ant_metrics files matching glob /mnt/sn1/2459878/zen.2459878.?????.sum.ant_metrics.hdf5

Load chi^2 info from redcal¶

In [8]:
use_redcal = False
glob_str = os.path.join(data_path, f'zen.{JD}.?????.sum{redcal_ext}')

redcal_files = sorted(glob.glob(glob_str))
if len(redcal_files) > 0:
    print(f'Found {len(redcal_files)} ant_metrics files matching glob {glob_str}')
    post_redcal_ant_flags_dict = {}
    flagged_by_redcal_dict = {}
    cspa_med_dict = {}
    for cal in redcal_files:
        hc = io.HERACal(cal)
        _, flags, cspa, chisq = hc.read()
        cspa_med_dict[cal] = {ant: np.nanmedian(cspa[ant], axis=1) for ant in cspa}

        post_redcal_ant_flags_dict[cal] = {ant: np.all(flags[ant]) for ant in flags}
        # check history to distinguish antennas flagged going into redcal from ones flagged during redcal
        tossed_antenna_lines =  hc.history.replace('\n','').split('Throwing out antenna ')[1:]
        flagged_by_redcal_dict[cal] = sorted([int(line.split(' ')[0]) for line in tossed_antenna_lines])
        
    use_redcal = True
else:
    print(f'No files found matching glob {glob_str}. Skipping redcal chisq.')
No files found matching glob /mnt/sn1/2459878/zen.2459878.?????.sum.known_good.omni.calfits. Skipping redcal chisq.

Figure out some general properties¶

In [9]:
# Parse some general array properties, taking into account the fact that we might be missing some of the metrics
ants = []
pols = []
antpol_pairs = []

if use_auto_metrics:
    ants = sorted(set(bl[0] for bl in auto_metrics['modzs']['r2_shape_modzs']))
    pols = sorted(set(bl[2] for bl in auto_metrics['modzs']['r2_shape_modzs']))
if use_ant_metrics:
    antpol_pairs = sorted(set([antpol for dms in ant_metrics_dead_metrics.values() for antpol in dms.keys()]))
    antpols = sorted(set(antpol[1] for antpol in antpol_pairs))
    ants = sorted(set(antpol[0] for antpol in antpol_pairs) | set(ants))
    pols = sorted(set(utils.join_pol(ap, ap) for ap in antpols) | set(pols))
if use_redcal:
    antpol_pairs = sorted(set([ant for cspa in cspa_med_dict.values() for ant in cspa.keys()]) | set(antpol_pairs))
    antpols = sorted(set(antpol[1] for antpol in antpol_pairs))
    ants = sorted(set(antpol[0] for antpol in antpol_pairs) | set(ants))
    pols = sorted(set(utils.join_pol(ap, ap) for ap in antpols) | set(pols))

# Figure out remaining antennas not in data and also LST range
data_files = sorted(glob.glob(os.path.join(data_path, 'zen.*.sum.uvh5')))
hd = io.HERAData(data_files[0])
unused_ants = [ant for ant in hd.antpos if ant not in ants]    
hd_last = io.HERAData(data_files[-1])

Load a priori antenna statuses and node numbers¶

In [10]:
# try to load a priori antenna statusesm but fail gracefully if this doesn't work.
a_priori_statuses = {ant: 'Not Found' for ant in ants}
nodes = {ant: np.nan for ant in ants + unused_ants}
try:
    from hera_mc import cm_hookup

    # get node numbers
    hookup = cm_hookup.get_hookup('default')
    for ant_name in hookup:
        ant = int("".join(filter(str.isdigit, ant_name)))
        if ant in nodes:
            if hookup[ant_name].get_part_from_type('node')['E<ground'] is not None:
                nodes[ant] = int(hookup[ant_name].get_part_from_type('node')['E<ground'][1:])
    
    # get apriori antenna status
    for ant_name, data in hookup.items():
        ant = int("".join(filter(str.isdigit, ant_name)))
        if ant in a_priori_statuses:
            a_priori_statuses[ant] = data.apriori

except Exception as err:
    print(f'Could not load node numbers and a priori antenna statuses.\nEncountered {type(err)} with message: {err}')

Summarize auto metrics¶

In [11]:
if use_auto_metrics:
    # Parse modzs
    modzs_to_check = {'Shape': 'r2_shape_modzs', 'Power': 'r2_power_modzs', 
                      'Temporal Variability': 'r2_temp_var_modzs', 'Temporal Discontinuties': 'r2_temp_diff_modzs'}
    worst_metrics = []
    worst_zs = []
    all_modzs = {}
    binary_flags = {rationale: [] for rationale in modzs_to_check}

    for ant in ants:
        # parse modzs and figure out flag counts
        modzs = {f'{pol} {rationale}': auto_metrics['modzs'][dict_name][(ant, ant, pol)] 
                 for rationale, dict_name in modzs_to_check.items() for pol in pols}
        for pol in pols:
            for rationale, dict_name in modzs_to_check.items():
                binary_flags[rationale].append(auto_metrics['modzs'][dict_name][(ant, ant, pol)] > mean_round_modz_cut)

        # parse out all metrics for dataframe
        for k in modzs:
            col_label = k + ' Modified Z-Score'
            if col_label in all_modzs:
                all_modzs[col_label].append(modzs[k])
            else:
                all_modzs[col_label] = [modzs[k]]
                
    mean_round_modz_cut = auto_metrics['parameters']['mean_round_modz_cut']
else:
    mean_round_modz_cut = 0

Summarize ant metrics¶

In [12]:
if use_ant_metrics:
    a_priori_flag_frac = {ant: np.mean([ant in apxa for apxa in ant_metrics_apriori_exants.values()]) for ant in ants}
    dead_ant_frac = {ap: {ant: np.mean([(ant, ap) in das for das in ant_metrics_dead_ants_dict.values()])
                                 for ant in ants} for ap in antpols}
    crossed_ant_frac = {ant: np.mean([np.any([(ant, ap) in cas for ap in antpols])
                                      for cas in ant_metrics_crossed_ants_dict.values()]) for ant in ants}
    ant_metrics_xants_frac_by_antpol = {antpol: np.mean([antpol in amx for amx in ant_metrics_xants_dict.values()]) for antpol in antpol_pairs}
    ant_metrics_xants_frac_by_ant = {ant: np.mean([np.any([(ant, ap) in amx for ap in antpols])
                                     for amx in ant_metrics_xants_dict.values()]) for ant in ants}
    average_dead_metrics = {ap: {ant: np.nanmean([dm.get((ant, ap), np.nan) for dm in ant_metrics_dead_metrics.values()]) 
                                 for ant in ants} for ap in antpols}
    average_crossed_metrics = {ant: np.nanmean([cm.get((ant, ap), np.nan) for ap in antpols 
                                                for cm in ant_metrics_crossed_metrics.values()]) for ant in ants}
else:
    dead_cut = 0.4
    crossed_cut = 0.0

Summarize redcal chi^2 metrics¶

In [13]:
if use_redcal:
    cspa = {ant: np.nanmedian(np.hstack([cspa_med_dict[cal][ant] for cal in redcal_files])) for ant in antpol_pairs}
    redcal_prior_flag_frac = {ant: np.mean([np.any([afd[ant, ap] and not ant in flagged_by_redcal_dict[cal] for ap in antpols])
                                            for cal, afd in post_redcal_ant_flags_dict.items()]) for ant in ants}
    redcal_flagged_frac = {ant: np.mean([ant in fbr for fbr in flagged_by_redcal_dict.values()]) for ant in ants}

Get FEM switch states¶

In [14]:
HHautos = sorted(glob.glob(f"{data_path}/zen.{JD}.*.sum.autos.uvh5"))
diffautos = sorted(glob.glob(f"{data_path}/zen.{JD}.*.diff.autos.uvh5"))

try:
    db = mc.connect_to_mc_db(None)
    session = db.sessionmaker()
    startJD = float(HHautos[0].split('zen.')[1].split('.sum')[0])
    stopJD = float(HHautos[-1].split('zen.')[1].split('.sum')[0])
    start_time = Time(startJD,format='jd')
    stop_time = Time(stopJD,format='jd')

    # get initial state by looking for commands up to 3 hours before the starttime
    # this logic can be improved after an upcoming hera_mc PR
    # which will return the most recent command before a particular time.
    search_start_time = start_time - TimeDelta(3*3600, format="sec")
    initial_command_res = session.get_array_signal_source(starttime=search_start_time, stoptime=start_time)
    if len(initial_command_res) == 0:
        initial_source = "Unknown"
    elif len(command_res) == 1:
        initial_source = initial_command_res[0].source
    else:
        # multiple commands
        times = []
        sources = []
        for obj in command_res:
            times.append(obj.time)
            sources.append(obj.source)
        initial_source = sources[np.argmax(times)]
    
    # check for any changes during observing
    command_res = session.get_array_signal_source(starttime=start_time, stoptime=stop_time)
    if len(command_res) == 0:
        # still nothing, set it to None
        obs_source = None
    else:
        obs_source_times = []
        obs_source = []
        for obj in command_res:
            obs_source_times.append(obj.time)
            obs_source.append(obj.source)

    if obs_source is not None:
        command_source = [initial_source] + obs_source
    else:
        command_source = initial_source
    
    res = session.get_antenna_status(starttime=startTime, stoptime=stopTime)
    fem_switches = {}
    right_rep_ant = []
    if len(res) > 0:
        for obj in res:
            if obj.antenna_number not in fem_switches.keys():
                fem_switches[obj.antenna_number] = {}
            fem_switches[obj.antenna_number][obj.antenna_feed_pol] = obj.fem_switch
        for ant, pol_dict in fem_switches.items():
            if pol_dict['e'] == initial_source and pol_dict['n'] == initial_source:
                right_rep_ant.append(ant)
except Exception as e:
    print(e)
    initial_source = None
    command_source = None
    right_rep_ant = []
name 'command_res' is not defined

Find X-engine Failures¶

In [15]:
read_inds = [1, len(HHautos)//2, -2]
x_status = [1,1,1,1,1,1,1,1]
s = UVData()
s.read(HHautos[1])

nants = len(s.get_ants())
freqs = s.freq_array[0]*1e-6
nfreqs = len(freqs)

antCon = {a: None for a in ants}
rightAnts = []
for i in read_inds:
    s = UVData()
    d = UVData()
    s.read(HHautos[i])
    d.read(diffautos[i])
    for pol in [0,1]:
        sm = np.abs(s.data_array[:,0,:,pol])
        df = np.abs(d.data_array[:,0,:,pol])
        sm = np.r_[sm, np.nan + np.zeros((-len(sm) % nants,len(freqs)))]
        sm = np.nanmean(sm.reshape(-1,nants,nfreqs),axis=1)
        df = np.r_[df, np.nan + np.zeros((-len(df) % nants,len(freqs)))]
        df = np.nanmean(df.reshape(-1,nants,nfreqs),axis=1)

        evens = (sm + df)/2
        odds = (sm - df)/2
        rat = np.divide(evens,odds)
        rat = np.nan_to_num(rat)
        for xbox in range(0,8):
            xavg = np.nanmean(rat[:,xbox*192:(xbox+1)*192],axis=1)
            if np.nanmax(xavg)>1.5 or np.nanmin(xavg)<0.5:
                x_status[xbox] = 0
    for ant in ants:
        for pol in ["xx", "yy"]:
            if antCon[ant] is False:
                continue
            spectrum = s.get_data(ant, ant, pol)
            stdev = np.std(spectrum)
            med = np.median(np.abs(spectrum))
            if (initial_source == 'digital_noise_same' or initial_source == 'digital_noise_different') and med < 10:
                antCon[ant] = True
            elif (initial_source == "load" or initial_source == 'noise') and 80000 < stdev <= 4000000 and antCon[ant] is not False:
                antCon[ant] = True
            elif initial_source == "antenna" and stdev > 500000 and med > 950000 and antCon[ant] is not False:
                antCon[ant] = True
            else:
                antCon[ant] = False
            if np.min(np.abs(spectrum)) < 100000:
                antCon[ant] = False
for ant in ants:
    if antCon[ant] is True:
        rightAnts.append(ant)
            
x_status_str = ''
for i,x in enumerate(x_status):
    if x==0:
        x_status_str += '\u274C '
    else:
        x_status_str += '\u2705 '

Build Overall Health DataFrame¶

In [16]:
def comma_sep_paragraph(vals, chars_per_line=40):
    outstrs = []
    for val in vals:
        if (len(outstrs) == 0) or (len(outstrs[-1]) > chars_per_line):
            outstrs.append(str(val))
        else:
            outstrs[-1] += ', ' + str(val)
    return ',<br>'.join(outstrs)
In [17]:
# Time data
to_show = {'JD': [JD]}
to_show['Date'] = f'{utc.month}-{utc.day}-{utc.year}'
to_show['LST Range'] = f'{hd.lsts[0] * 12 / np.pi:.3f} -- {hd_last.lsts[-1] * 12 / np.pi:.3f} hours'

# X-engine status
to_show['X-Engine Status'] = x_status_str

# Files
to_show['Number of Files'] = len(data_files)

# Antenna Calculations
to_show['Total Number of Antennas'] = len(ants)

to_show[' '] = ''
to_show['OPERATIONAL STATUS SUMMARY'] = ''

status_count = {status: 0 for status in status_colors}
for ant, status in a_priori_statuses.items():
    if status in status_count:
        status_count[status] = status_count[status] + 1
    else:
        status_count[status] = 1
to_show['Antenna A Priori Status Count'] = '<br>'.join([f'{status}: {status_count[status]}' for status in status_colors if status in status_count and status_count[status] > 0])

to_show['Commanded Signal Source'] = ', '.join(command_source if hasattr(command_source, '__iter__') else [str(command_source)])
to_show['Antennas in Commanded State (reported)'] = f'{len(right_rep_ant)} / {len(ants)} ({len(right_rep_ant) / len(ants):.1%})'
to_show['Antennas in Commanded State (observed)'] = f'{len(rightAnts)} / {len(ants)} ({len(rightAnts) / len(ants):.1%})'

if use_ant_metrics:
    to_show['Cross-Polarized Antennas'] = ', '.join([str(ant) for ant in ants if (np.max([dead_ant_frac[ap][ant] for ap in antpols]) + crossed_ant_frac[ant] == 1) 
                                                                                 and (crossed_ant_frac[ant] > .5)])

# Node calculations
nodes_used = set([nodes[ant] for ant in ants if np.isfinite(nodes[ant])])
to_show['Total Number of Nodes'] = len(nodes_used)
if use_ant_metrics:
    node_off = {node: True for node in nodes_used}
    not_correlating = {node: True for node in nodes_used}
    for ant in ants:
        for ap in antpols:
            if np.isfinite(nodes[ant]):
                if np.isfinite(average_dead_metrics[ap][ant]):
                    node_off[nodes[ant]] = False
                if dead_ant_frac[ap][ant] < 1:
                    not_correlating[nodes[ant]] = False
    to_show['Nodes Registering 0s'] = ', '.join([f'N{n:02}' for n in sorted([node for node in node_off if node_off[node]])])
    to_show['Nodes Not Correlating'] = ', '.join([f'N{n:02}' for n in sorted([node for node in not_correlating if not_correlating[node] and not node_off[node]])])

# Pipeline calculations    
to_show['  '] = ''
to_show['NIGHTLY ANALYSIS SUMMARY'] = ''
    
all_flagged_ants = []
if use_ant_metrics:
    to_show['Ant Metrics Done?'] = '\u2705'
    ant_metrics_flagged_ants = [ant for ant in ants if ant_metrics_xants_frac_by_ant[ant] > 0]
    all_flagged_ants.extend(ant_metrics_flagged_ants)
    to_show['Ant Metrics Flagged Antennas'] = f'{len(ant_metrics_flagged_ants)} / {len(ants)} ({len(ant_metrics_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Ant Metrics Done?'] = '\u274C'
if use_auto_metrics:
    to_show['Auto Metrics Done?'] = '\u2705'
    auto_metrics_flagged_ants = [ant for ant in ants if ant in auto_ex_ants]
    all_flagged_ants.extend(auto_metrics_flagged_ants)    
    to_show['Auto Metrics Flagged Antennas'] = f'{len(auto_metrics_flagged_ants)} / {len(ants)} ({len(auto_metrics_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Auto Metrics Done?'] = '\u274C'
if use_redcal:
    to_show['Redcal Done?'] = '\u2705'    
    redcal_flagged_ants = [ant for ant in ants if redcal_flagged_frac[ant] > 0]
    all_flagged_ants.extend(redcal_flagged_ants)    
    to_show['Redcal Flagged Antennas'] = f'{len(redcal_flagged_ants)} / {len(ants)} ({len(redcal_flagged_ants) / len(ants):.1%})' 
else:
    to_show['Redcal Done?'] = '\u274C' 
to_show['Never Flagged Antennas'] = f'{len(ants) - len(set(all_flagged_ants))} / {len(ants)} ({(len(ants) - len(set(all_flagged_ants))) / len(ants):.1%})'

# Count bad antennas with good statuses and vice versa
n_apriori_good = len([ant for ant in ants if a_priori_statuses[ant] in good_statuses.split(',')])
apriori_good_flagged = []
aprior_bad_unflagged = []
for ant in ants:
    if ant in set(all_flagged_ants) and a_priori_statuses[ant] in good_statuses.split(','):
        apriori_good_flagged.append(ant)
    elif ant not in set(all_flagged_ants) and a_priori_statuses[ant] not in good_statuses.split(','):
        aprior_bad_unflagged.append(ant)
to_show['A Priori Good Antennas Flagged'] = f'{len(apriori_good_flagged)} / {n_apriori_good} total a priori good antennas:<br>' + \
                                            comma_sep_paragraph(apriori_good_flagged)
to_show['A Priori Bad Antennas Not Flagged'] = f'{len(aprior_bad_unflagged)} / {len(ants) - n_apriori_good} total a priori bad antennas:<br>' + \
                                            comma_sep_paragraph(aprior_bad_unflagged)

# Apply Styling
df = pd.DataFrame(to_show)
divider_cols = [df.columns.get_loc(col) for col in ['NIGHTLY ANALYSIS SUMMARY', 'OPERATIONAL STATUS SUMMARY']]
try:
    to_red_columns = [df.columns.get_loc(col) for col in ['Cross-Polarized Antennas', 'Nodes Registering 0s', 
                                                          'Nodes Not Correlating', 'A Priori Good Antennas Flagged']]
except:
    to_red_columns = []
def red_specific_cells(x):
    df1 = pd.DataFrame('', index=x.index, columns=x.columns)
    for col in to_red_columns:
        df1.iloc[col] = 'color: red'
    return df1

df = df.T
table = df.style.hide_columns().apply(red_specific_cells, axis=None)
for col in divider_cols:
    table = table.set_table_styles([{"selector":f"tr:nth-child({col+1})", "props": [("background-color", "black"), ("color", "white")]}], overwrite=False)

Table 1: Overall Array Health¶

In [18]:
HTML(table.render())
Out[18]:
JD 2459878
Date 10-25-2022
LST Range 22.496 -- 7.908 hours
X-Engine Status ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
Number of Files 1717
Total Number of Antennas 201
OPERATIONAL STATUS SUMMARY
Antenna A Priori Status Count dish_maintenance: 7
dish_ok: 1
RF_maintenance: 54
RF_ok: 19
digital_ok: 96
not_connected: 24
Commanded Signal Source None
Antennas in Commanded State (reported) 0 / 201 (0.0%)
Antennas in Commanded State (observed) 0 / 201 (0.0%)
Cross-Polarized Antennas
Total Number of Nodes 18
Nodes Registering 0s
Nodes Not Correlating N09
NIGHTLY ANALYSIS SUMMARY
Ant Metrics Done? ✅
Ant Metrics Flagged Antennas 169 / 201 (84.1%)
Auto Metrics Done? ✅
Auto Metrics Flagged Antennas 183 / 201 (91.0%)
Redcal Done? ❌
Never Flagged Antennas 4 / 201 (2.0%)
A Priori Good Antennas Flagged 92 / 96 total a priori good antennas:
3, 5, 7, 9, 10, 15, 16, 17, 19, 20, 21, 29,
30, 31, 37, 38, 40, 41, 42, 44, 45, 51, 53,
54, 55, 56, 59, 65, 66, 67, 68, 69, 70, 71,
72, 81, 83, 84, 86, 88, 91, 93, 94, 98, 99,
100, 101, 103, 105, 106, 107, 108, 109, 111,
116, 117, 118, 121, 122, 123, 124, 127, 128,
129, 130, 136, 140, 141, 142, 143, 144, 146,
147, 158, 160, 161, 162, 164, 165, 167, 169,
170, 181, 183, 184, 185, 186, 187, 189, 190,
191, 202
A Priori Bad Antennas Not Flagged 0 / 105 total a priori bad antennas:
In [19]:
# write to csv
outpath = os.path.join(nb_outdir, f'array_health_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.replace({'\u2705': 'Y'}, regex=True).replace({'\u274C': 'N'}, regex=True).replace({'<br>': ' '}, regex=True).to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/array_health_table_2459878.csv

Build DataFrame¶

In [20]:
# build dataframe
to_show = {'Ant': [f'<a href="{ant_to_report_url(ant)}" target="_blank">{ant}</a>' for ant in ants],
           'Node': [f'N{nodes[ant]:02}' for ant in ants], 
           'A Priori Status': [a_priori_statuses[ant] for ant in ants]}
           #'Worst Metric': worst_metrics, 'Worst Modified Z-Score': worst_zs}
df = pd.DataFrame(to_show)

# create bar chart columns for flagging percentages:
bar_cols = {}
if use_auto_metrics:
    bar_cols['Auto Metrics Flags'] = [float(ant in auto_ex_ants) for ant in ants]
if use_ant_metrics:
    if np.sum(list(a_priori_flag_frac.values())) > 0:  # only include this col if there are any a priori flags
        bar_cols['A Priori Flag Fraction in Ant Metrics'] = [a_priori_flag_frac[ant] for ant in ants]
    for ap in antpols:
        bar_cols[f'Dead Fraction in Ant Metrics ({ap})'] = [dead_ant_frac[ap][ant] for ant in ants]
    bar_cols['Crossed Fraction in Ant Metrics'] = [crossed_ant_frac[ant] for ant in ants]
if use_redcal:
    bar_cols['Flag Fraction Before Redcal'] = [redcal_prior_flag_frac[ant] for ant in ants]
    bar_cols['Flagged By Redcal chi^2 Fraction'] = [redcal_flagged_frac[ant] for ant in ants]  
for col in bar_cols:
    df[col] = bar_cols[col]

# add auto_metrics
if use_auto_metrics:
    for label, modz in all_modzs.items():
        df[label] = modz
z_score_cols = [col for col in df.columns if 'Modified Z-Score' in col]        
        
# add ant_metrics
ant_metrics_cols = {}
if use_ant_metrics:
    for ap in antpols:
        ant_metrics_cols[f'Average Dead Ant Metric ({ap})'] = [average_dead_metrics[ap][ant] for ant in ants]
    ant_metrics_cols['Average Crossed Ant Metric'] = [average_crossed_metrics[ant] for ant in ants]
    for col in ant_metrics_cols:
        df[col] = ant_metrics_cols[col]   

# add redcal chisq
redcal_cols = []
if use_redcal:
    for ap in antpols:
        col_title = f'Median chi^2 Per Antenna ({ap})'
        df[col_title] = [cspa[ant, ap] for ant in ants]
        redcal_cols.append(col_title)

# sort by node number and then by antenna number within nodes
df.sort_values(['Node', 'Ant'], ascending=True)

# style dataframe
table = df.style.hide_index()\
          .applymap(lambda val: f'background-color: {status_colors[val]}' if val in status_colors else '', subset=['A Priori Status']) \
          .background_gradient(cmap='viridis', vmax=mean_round_modz_cut * 3, vmin=0, axis=None, subset=z_score_cols) \
          .background_gradient(cmap='bwr_r', vmin=dead_cut-.25, vmax=dead_cut+.25, axis=0, subset=list([col for col in ant_metrics_cols if 'dead' in col.lower()])) \
          .background_gradient(cmap='bwr_r', vmin=crossed_cut-.25, vmax=crossed_cut+.25, axis=0, subset=list([col for col in ant_metrics_cols if 'crossed' in col.lower()])) \
          .background_gradient(cmap='plasma', vmax=4, vmin=1, axis=None, subset=redcal_cols) \
          .applymap(lambda val: 'font-weight: bold' if val < dead_cut else '', subset=list([col for col in ant_metrics_cols if 'dead' in col.lower()])) \
          .applymap(lambda val: 'font-weight: bold' if val < crossed_cut else '', subset=list([col for col in ant_metrics_cols if 'crossed' in col.lower()])) \
          .applymap(lambda val: 'font-weight: bold' if val > mean_round_modz_cut else '', subset=z_score_cols) \
          .applymap(lambda val: 'color: red' if val > mean_round_modz_cut else '', subset=z_score_cols) \
          .bar(subset=list(bar_cols.keys()), vmin=0, vmax=1) \
          .format({col: '{:,.4f}'.format for col in z_score_cols}) \
          .format({col: '{:,.4f}'.format for col in ant_metrics_cols}) \
          .format({col: '{:,.2%}'.format for col in bar_cols}) \
          .applymap(lambda val: 'font-weight: bold', subset=['Ant']) \
          .set_table_styles([dict(selector="th",props=[('max-width', f'70pt')])])

Table 2: RTP Per-Antenna Metrics Summary Table¶

This admittedly very busy table incorporates summary information about all antennas in the array. Its columns depend on what information is available when the notebook is run (i.e. whether auto_metrics, ant_metrics, and/or redcal is done). These can be divided into 5 sections:

Basic Antenna Info: antenna number, node, and its a priori status.

Flag Fractions: Fraction of the night that an antenna was flagged for various reasons. Note that auto_metrics flags antennas for the whole night, so it'll be 0% or 100%.

auto_metrics Details: If auto_metrics is included, this section shows the modified Z-score signifying how much of an outlier each antenna and polarization is in each of four categories: bandpass shape, overall power, temporal variability, and temporal discontinuities. Bold red text indicates that this is a reason for flagging the antenna. It is reproduced from the auto_metrics_inspect.ipynb nightly notebook, so check that out for more details on the precise metrics.

ant_metrics Details: If ant_metrics is included, this section shows the average correlation-based metrics for antennas over the whole night. Low "dead ant" metrics (nominally below 0.4) indicate antennas not correlating with the rest of the array. Negative "crossed ant" metrics indicate antennas that show stronger correlations in their cross-pols than their same-pols, indicating that the two polarizations are probably swapped. Bold text indicates that the average is below the threshold for flagging.

redcal chi^2 Details: If redcal is included, this shows the median chi^2 per antenna. This would be 1 in an ideal array. Antennas are thrown out when they they are outliers in their median chi^2, usually greater than 4-sigma outliers in modified Z-score.

In [21]:
HTML(table.render())
Out[21]:
Ant Node A Priori Status Auto Metrics Flags Dead Fraction in Ant Metrics (Jee) Dead Fraction in Ant Metrics (Jnn) Crossed Fraction in Ant Metrics ee Shape Modified Z-Score nn Shape Modified Z-Score ee Power Modified Z-Score nn Power Modified Z-Score ee Temporal Variability Modified Z-Score nn Temporal Variability Modified Z-Score ee Temporal Discontinuties Modified Z-Score nn Temporal Discontinuties Modified Z-Score Average Dead Ant Metric (Jee) Average Dead Ant Metric (Jnn) Average Crossed Ant Metric
3 N01 digital_ok 0.00% 0.06% 0.12% 0.00% -1.645381 -1.115156 -0.649361 -0.527201 -0.635602 -0.539033 -0.131758 3.650558 0.672907 0.674760 0.408071
4 N01 RF_maintenance 100.00% 0.12% 0.00% 0.00% 1.325127 6.015283 2.935487 0.013830 0.136720 0.251980 20.465313 1.968399 0.671528 0.671110 0.396883
5 N01 digital_ok 100.00% 0.06% 0.12% 0.00% 0.170374 0.445330 -0.545896 2.336117 -0.717304 0.704651 6.268677 -0.180476 0.676884 0.678522 0.394245
7 N02 digital_ok 100.00% 0.00% 0.00% 0.00% -1.826887 -1.769070 0.237816 0.523356 -0.718571 0.586784 12.980267 27.700082 0.669571 0.679248 0.396162
8 N02 RF_maintenance 100.00% 0.00% 0.06% 0.00% 1.135748 -0.909710 0.644116 0.431701 -0.859637 -0.602293 11.991754 3.045244 0.661248 0.670010 0.389129
9 N02 digital_ok 0.00% 0.00% 0.06% 0.00% -0.268190 -1.267602 0.475245 0.205358 0.734889 -0.097036 -0.181144 0.404401 0.664285 0.671617 0.403616
10 N02 digital_ok 100.00% 0.00% 0.06% 0.00% 16.098306 -1.031796 7.815856 6.498985 12.126952 4.169684 6.145974 0.479808 0.655603 0.670214 0.405410
15 N01 digital_ok 100.00% 0.06% 0.06% 0.00% 1.616592 0.529603 1.609040 -0.552759 0.027402 -0.356440 17.881283 6.943862 0.673931 0.683204 0.396351
16 N01 digital_ok 100.00% 0.00% 0.06% 0.00% 0.209986 0.972608 0.183589 -0.717253 0.435613 1.743294 8.207976 14.842398 0.676300 0.682377 0.389342
17 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.150079 1.217450 -0.027162 0.517168 -0.186406 0.317041 13.291549 6.199582 0.677329 0.688625 0.389784
18 N01 RF_maintenance 100.00% 0.00% 0.12% 0.00% 9.069298 22.413196 0.347188 2.044907 56.342692 53.405346 86.077052 86.844489 0.653926 0.464173 0.468346
19 N02 digital_ok 100.00% 0.00% 0.06% 0.00% 1.226747 0.095291 -0.156409 16.731051 0.298621 5.174456 13.704482 25.847013 0.670490 0.670220 0.395222
20 N02 digital_ok 100.00% 0.00% 0.06% 0.00% 0.133977 5.208695 0.289220 16.890981 1.165861 2.818632 11.722231 -0.949721 0.674788 0.677092 0.396688
21 N02 digital_ok 100.00% 0.00% 0.00% 0.00% 1.966757 0.897242 -0.264540 7.266583 1.412099 2.503565 2.503321 73.456615 0.662173 0.664498 0.400457
22 N06 not_connected 100.00% 0.12% 0.06% 0.00% 46.309358 15.931816 5.265316 16.494020 12.435527 9.220739 39.256383 40.745215 0.456917 0.608883 0.326403
27 N01 RF_maintenance 100.00% 100.00% 100.00% 0.00% 17.209975 18.755578 55.045739 55.379467 54.311781 50.373635 14.212840 10.259591 0.034726 0.039468 0.004944
28 N01 RF_maintenance 100.00% 0.06% 84.48% 0.00% 20.198463 39.549007 5.602748 4.432916 65.592694 53.471677 16.136289 55.080625 0.361767 0.165040 0.259463
29 N01 digital_ok 100.00% 0.06% 0.06% 0.00% -1.772992 -0.136079 -0.832354 0.406221 -0.943411 -0.815449 0.462366 12.066014 0.680370 0.685850 0.383714
30 N01 digital_ok 100.00% 0.00% 0.00% 0.00% 0.081872 -1.364919 2.916874 -0.941105 0.294667 0.156832 21.135495 0.180830 0.678873 0.691572 0.386992
31 N02 digital_ok 100.00% 0.06% 0.06% 0.00% -0.403314 2.830163 1.106432 0.335185 0.182441 6.082872 9.146348 11.556714 0.687631 0.686853 0.396374
32 N02 RF_maintenance 100.00% 0.06% 0.06% 0.00% 32.600677 31.134414 8.516598 3.961308 6.437506 10.658712 44.495778 63.698355 0.550134 0.594622 0.230175
34 N06 not_connected 100.00% 100.00% 0.00% 0.00% 19.645519 4.282998 23.908565 18.007801 12.986403 7.242538 5.834231 -1.246838 0.045443 0.664005 0.437870
35 N06 not_connected 100.00% 0.00% 0.12% 0.00% 7.877095 2.253462 40.827972 12.047099 8.463284 3.357530 -6.476754 2.299733 0.645448 0.646520 0.395948
36 N03 RF_maintenance 100.00% 0.06% 0.12% 0.00% 12.507289 11.626506 0.823110 0.581598 0.769569 1.599377 3.291416 14.490219 0.671157 0.679837 0.403551
37 N03 digital_ok 100.00% 2.33% 2.33% 0.00% 0.477601 1.353361 3.659076 4.479862 23.252979 23.328309 -0.203688 24.571454 0.676478 0.689332 0.413628
38 N03 digital_ok 100.00% 2.28% 2.33% 0.00% 1.005750 0.108188 0.131536 -0.278855 23.289719 23.570350 18.956704 4.196544 0.680704 0.694513 0.410782
40 N04 digital_ok 0.00% 0.06% 0.12% 0.00% 0.012010 -0.012010 -0.702028 -0.712866 0.433642 -0.526619 -0.440321 -1.216547 0.677848 0.687204 0.392245
41 N04 digital_ok 0.00% 0.06% 0.06% 0.00% -0.413778 1.023833 2.306509 1.160776 2.048328 -0.743664 -0.248086 1.370875 0.682807 0.686794 0.379865
42 N04 digital_ok 0.00% 0.12% 0.12% 0.00% -0.462422 1.193988 -0.561688 1.732903 -0.245006 -0.486903 0.909174 -0.588899 0.691091 0.699493 0.390931
43 N05 RF_maintenance 100.00% 100.00% 0.00% 0.00% 16.122760 5.582609 55.454752 0.031450 12.992985 0.734032 7.799563 8.819591 0.043666 0.692635 0.424472
44 N05 digital_ok 100.00% 0.06% 0.06% 0.00% 14.071878 3.626840 1.197583 3.869385 9.407619 1.270279 300.481584 48.123163 0.653828 0.690903 0.378848
45 N05 digital_ok 100.00% 99.82% 100.00% 0.00% 377.166466 376.790429 inf inf 5736.074129 5509.294886 12919.457944 11830.618812 0.259391 0.155784 0.116480
46 N05 RF_maintenance 100.00% 99.82% 99.88% 0.00% 224.306715 220.837433 inf inf 6039.682651 5843.586908 15778.136661 17000.811309 0.247232 0.213880 0.062043
47 N06 not_connected 100.00% 99.82% 2.22% 0.00% 18.399690 3.903330 23.295346 12.270284 27.634004 23.844433 5.548593 16.384057 0.040446 0.662705 0.430306
48 N06 not_connected 100.00% 0.00% 0.06% 0.00% 3.361990 4.157935 24.265688 28.731756 2.773357 5.030756 1.434902 -3.526416 0.653082 0.674130 0.401939
49 N06 not_connected 100.00% 0.00% 0.06% 0.00% 2.275499 3.772469 11.836204 27.989158 2.063518 5.555589 2.800019 -0.790582 0.624223 0.660354 0.396084
50 N03 RF_maintenance 100.00% 0.06% 0.12% 0.00% 2.312338 38.070739 -0.284991 4.967956 3.571661 6.124754 18.302624 69.715132 0.662666 0.600415 0.368928
51 N03 digital_ok 100.00% 100.00% 0.00% 0.00% 37.110257 1.958388 71.931401 1.018496 13.282521 3.776986 37.506352 20.972371 0.042660 0.690537 0.474541
52 N03 RF_maintenance 100.00% 0.00% 0.00% 0.00% 10.977423 9.618202 0.626146 0.366544 2.926281 -0.732644 4.701851 4.188931 0.685461 0.696797 0.395683
53 N03 digital_ok 100.00% 0.12% 0.12% 0.00% 1.146052 4.105565 -0.015543 1.039033 0.014634 0.388539 10.421343 19.248984 0.689961 0.701047 0.396794
54 N04 digital_ok 100.00% 100.00% 100.00% 0.00% 17.208683 19.738172 56.066711 57.710218 13.006180 17.778896 10.080553 5.522826 0.048263 0.047045 0.001540
55 N04 digital_ok 100.00% 0.18% 100.00% 0.00% 3.891039 20.884594 1.571114 57.195611 8.499214 17.807832 18.007871 13.396895 0.674752 0.036325 0.428532
56 N04 digital_ok 100.00% 0.06% 0.06% 0.00% 1.105967 1.715371 0.696778 0.236152 1.255379 2.284187 9.622275 43.299454 0.684418 0.696798 0.372774
57 N04 RF_maintenance 100.00% 0.00% 0.06% 0.00% 50.660012 1.266009 20.854549 -0.408593 8.213597 1.024012 13.201627 5.429507 0.525826 0.699086 0.390794
58 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 16.578034 19.527269 55.790359 57.462579 13.032427 17.882638 12.864551 9.966966 0.039234 0.036300 0.001848
59 N05 digital_ok 100.00% 0.06% 0.12% 0.00% 38.182021 8.313588 5.189374 0.168668 5.047969 1.769124 33.229004 67.963576 0.600986 0.682756 0.382161
60 N05 RF_maintenance 100.00% 100.00% 100.00% 0.00% 17.917736 19.104837 55.961700 57.339667 13.057645 17.893440 10.838381 12.621050 0.028352 0.028453 0.001591
61 N06 not_connected 100.00% 2.04% 2.04% 0.00% 6.248406 5.761758 3.974078 0.078331 23.906009 24.096704 0.386570 7.693490 0.631898 0.640700 0.384686
62 N06 not_connected 100.00% 0.00% 0.12% 0.00% 2.401179 4.302249 19.542040 27.491468 2.161587 6.502776 3.231413 -3.344526 0.660499 0.679437 0.391034
63 N06 not_connected 100.00% 0.00% 100.00% 0.00% 15.369254 19.586895 19.261254 23.847647 4.086481 17.814283 1.230581 10.617906 0.600839 0.046141 0.384623
64 N06 not_connected 100.00% 0.00% 0.12% 0.00% 3.176915 2.715147 12.193959 22.730895 1.292424 3.810911 1.560377 -2.007037 0.614662 0.648984 0.397023
65 N03 digital_ok 0.00% 0.00% 0.12% 0.00% 1.783296 1.684919 1.399776 1.569577 3.118749 1.910277 0.841792 0.872623 0.663158 0.684625 0.411727
66 N03 digital_ok 100.00% 0.06% 0.12% 0.00% 0.314303 2.342244 11.024244 7.130920 3.014863 0.401649 1.179552 6.704152 0.667352 0.686568 0.402481
67 N03 digital_ok 100.00% 0.00% 0.00% 0.00% -0.150727 0.299422 7.029462 3.323643 0.015634 -0.194800 3.321259 5.902988 0.673896 0.690982 0.394923
68 N03 digital_ok 100.00% 2.33% 100.00% 0.00% 4.016502 41.091199 2.155202 76.957575 23.068706 30.242014 7.301643 31.182292 0.676600 0.033328 0.465709
69 N04 digital_ok 0.00% 0.12% 0.12% 0.00% 0.139540 -0.850128 0.510149 -0.471242 1.858866 2.069292 0.256208 -0.067462 0.685204 0.700032 0.384095
70 N04 digital_ok 0.00% 0.06% 0.12% 0.00% 0.677194 -0.172866 1.451034 2.235705 1.061635 0.362344 0.180936 0.067462 0.690766 0.703479 0.384152
71 N04 digital_ok 100.00% 0.06% 0.23% 0.00% 10.538089 -0.890918 2.753152 2.324827 1.002737 1.708655 10.233489 3.068851 0.697413 0.702280 0.381952
72 N04 digital_ok 100.00% 0.00% 0.00% 0.00% 5.575592 -0.429934 2.388172 1.928537 3.370053 0.710603 22.119836 5.219096 0.675005 0.691401 0.379318
73 N05 RF_maintenance 100.00% 99.88% 99.88% 0.00% 322.153307 320.294644 inf inf 7633.650385 8078.760256 14295.246389 18339.993957 0.218556 0.214640 0.048107
74 N05 RF_maintenance 100.00% 100.00% 0.29% 0.00% 17.688198 15.904723 57.565363 55.182912 13.054733 15.776825 12.103005 78.331657 0.032803 0.336031 0.196302
77 N06 not_connected 100.00% 2.16% 2.10% 0.00% 35.474475 37.867415 19.710291 15.672600 24.746538 26.818683 14.365600 5.004498 0.534245 0.522686 0.179685
78 N06 not_connected 100.00% 0.12% 0.12% 0.00% 49.145879 1.410322 15.055651 19.844262 7.743394 2.696770 8.607882 2.523258 0.477419 0.661957 0.370136
79 N11 not_connected 100.00% 0.00% 0.00% 0.00% 5.072823 6.096548 35.328099 36.577371 6.188506 9.683092 -0.042062 -5.183999 0.650412 0.671527 0.397941
80 N11 not_connected 100.00% 0.18% 100.00% 0.00% 15.197222 21.405297 33.158481 23.167339 11.573738 17.858428 30.540935 5.735889 0.310101 0.041438 0.175479
81 N07 digital_ok 100.00% 50.23% 50.23% 0.00% 0.420601 1.174547 0.117336 19.482508 -0.191865 41.751221 0.627104 3.283562 0.365009 0.376031 0.188122
82 N07 RF_maintenance 100.00% 50.18% 50.12% 0.00% 3.486715 0.685087 -0.020064 7.294279 -0.234134 0.070824 0.935700 -0.219320 0.371821 0.378976 0.182567
83 N07 digital_ok 0.00% 50.18% 50.12% 0.00% 0.053203 0.117113 -0.380630 0.394529 -1.219653 1.120855 -0.750810 1.197015 0.381539 0.382333 0.178320
84 N08 digital_ok 100.00% 0.00% 100.00% 0.00% 3.832945 36.547872 27.531561 73.960424 3.957228 17.308799 9.563179 18.154485 0.650715 0.039992 0.383582
85 N08 digital_ok 0.00% 0.00% 0.00% 0.00% 0.920058 0.726551 -0.184290 -0.594643 -0.896402 0.408330 -0.691439 -0.904558 0.681486 0.689329 0.380949
86 N08 digital_ok 100.00% 0.06% 0.06% 0.00% 3.073799 8.938314 5.837925 2.554821 9.267399 2.198123 3.029126 60.438756 0.670976 0.666552 0.365530
87 N08 RF_maintenance 100.00% 2.22% 2.22% 0.00% 14.445936 10.638436 5.257959 0.498445 42.125155 24.005954 17.548815 3.993965 0.621687 0.708771 0.362379
88 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 2.476491 0.581841 0.768783 1.142615 -0.459791 3.169602 24.413317 7.837332 0.066541 0.072330 0.010795
89 N09 RF_maintenance 0.00% 100.00% 100.00% 0.00% 1.659582 0.028571 -0.543703 0.352620 -0.057698 -0.429325 -1.277977 -1.725756 0.061370 0.065006 0.007306
90 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% 1.268450 0.280680 0.004092 1.899278 -1.007660 0.457437 2.572203 13.301892 0.066384 0.072810 0.010130
91 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 1.406151 -0.107135 0.047561 0.262654 -0.356299 -0.321365 14.086259 4.153958 0.080242 0.078534 0.021139
92 N10 RF_maintenance 100.00% 0.23% 18.44% 0.00% 56.753085 64.956046 6.687126 8.081595 12.912928 17.713535 2.481904 14.475361 0.294219 0.242935 0.096455
93 N10 digital_ok 100.00% 0.00% 0.12% 0.00% 3.995669 0.316709 6.725655 4.062005 2.418536 0.228348 12.618176 -0.380795 0.673784 0.694158 0.391212
94 N10 digital_ok 100.00% 0.00% 0.12% 0.00% -0.935501 0.396870 0.798632 0.040791 1.627243 3.260945 9.626671 7.304215 0.673066 0.682464 0.388845
95 N11 not_connected 100.00% 0.06% 0.00% 99.71% 7.437028 7.517050 40.733630 40.629272 8.027365 14.673521 -4.336729 -5.103599 0.250654 0.249835 -0.278515
96 N11 not_connected 100.00% 100.00% 100.00% 0.00% 18.826414 20.857563 22.826858 24.161676 13.009557 17.953752 6.668317 4.378556 0.035206 0.042891 0.004912
97 N11 not_connected 100.00% 0.00% 0.12% 0.00% 6.584250 6.661031 39.055059 2.775347 7.876030 3.743230 -6.282030 34.106882 0.628022 0.620343 0.393027
98 N07 digital_ok 100.00% 50.23% 50.18% 0.00% 1.987804 10.844204 -0.387313 0.720780 2.015297 3.068066 3.260003 9.224454 0.363678 0.369410 0.180612
99 N07 digital_ok 100.00% 50.18% 50.18% 0.00% 3.132485 -0.539866 0.876725 0.819437 -0.802670 6.567821 7.538084 0.475114 0.367023 0.374283 0.180312
100 N07 digital_ok 0.00% 50.18% 50.18% 0.00% 0.163906 -0.494456 -0.716459 2.136124 1.380818 -0.616656 0.382456 0.591219 0.375502 0.377991 0.177958
101 N08 digital_ok 100.00% 2.22% 2.22% 0.00% 10.797229 12.740084 1.920709 2.258178 23.042602 23.369708 2.192971 0.759768 0.683717 0.695361 0.388860
102 N08 RF_maintenance 100.00% 86.41% 100.00% 0.00% 19.233249 19.553343 50.619993 54.311944 14.146439 17.889940 4.406433 15.050075 0.155908 0.041869 0.065778
103 N08 digital_ok 100.00% 99.94% 99.94% 0.00% 35.806649 37.439057 64.689327 65.834832 27.680224 30.506562 31.093666 27.482209 0.027858 0.029828 0.002555
104 N08 RF_maintenance 100.00% 2.10% 2.10% 0.00% 3.640322 88.453735 36.642946 38.271236 24.073396 25.569443 0.020407 -0.975223 0.641018 0.671626 0.378328
105 N09 digital_ok 0.00% 100.00% 100.00% 0.00% 0.834064 0.131262 -0.672052 0.675637 -0.145278 0.326212 1.057253 -0.830238 0.068042 0.072893 0.011572
106 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 0.730339 1.071487 5.116519 2.089137 4.446524 1.642416 1.320385 0.391646 0.059736 0.061765 0.006994
107 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 4.034372 0.697375 1.101247 4.809366 1.007570 0.131787 8.175325 11.443887 0.049767 0.057538 0.004229
108 N09 digital_ok 100.00% 100.00% 100.00% 0.00% 16.492359 4.127741 54.936736 0.777042 12.425194 1.219777 8.867723 5.436227 0.052268 0.067209 0.042983
109 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -0.260700 19.333804 1.997685 55.713974 -0.277566 17.783539 1.583407 7.771113 0.685061 0.037224 0.400451
110 N10 RF_maintenance 100.00% 0.00% 100.00% 0.00% 0.934829 38.880864 -0.048626 74.875978 -0.302959 17.280695 3.523456 16.043010 0.694173 0.035298 0.403521
111 N10 digital_ok 100.00% 0.00% 100.00% 0.00% -0.341300 19.088269 1.561599 56.308230 0.743980 17.785599 12.982227 9.371180 0.680263 0.037166 0.399016
112 N10 digital_ok 0.00% 0.00% 0.00% 0.00% 0.395186 -0.718915 -0.673344 1.803965 0.057698 2.466968 2.892882 -0.813485 0.668143 0.689531 0.398989
113 N11 not_connected 100.00% 100.00% 100.00% 0.00% 20.035062 20.877171 21.564860 23.552254 13.002033 17.921268 8.365370 4.421567 0.040565 0.032155 0.004976
114 N11 not_connected 100.00% 0.00% 0.00% 0.00% 13.363807 7.873113 11.990372 38.683860 8.345731 11.505775 5.760819 -4.168178 0.477918 0.656017 0.439694
115 N11 not_connected 100.00% 0.00% 0.00% 0.00% 4.506410 12.122735 32.978365 31.180559 5.033630 8.388811 -4.006791 -1.146160 0.629983 0.606761 0.397967
116 N07 digital_ok 100.00% 50.18% 50.18% 0.00% 0.074808 2.198708 5.052369 2.238442 3.047223 1.573315 3.292284 2.737153 0.370124 0.371680 0.183825
117 N07 digital_ok 100.00% 99.94% 99.94% 0.00% 18.594996 21.438377 56.713046 59.583191 27.620035 30.578150 6.449670 13.015625 0.027279 0.028947 0.001545
118 N07 digital_ok 100.00% 52.51% 52.45% 0.00% -0.034091 1.706619 -0.591377 1.474396 23.249046 23.973989 8.784861 11.130566 0.366296 0.373079 0.179885
119 N07 RF_maintenance 100.00% 50.23% 50.18% 0.00% 1.765163 5.013332 3.723142 21.442050 -1.127455 13.561086 1.487272 5.391150 0.387557 0.377180 0.184705
120 N08 RF_maintenance 100.00% 2.33% 100.00% 0.00% 24.803809 36.644453 26.562413 73.972078 26.077582 30.337399 -4.435423 29.920284 0.349957 0.040345 0.189868
121 N08 digital_ok 100.00% 0.12% 0.00% 0.00% 4.856553 7.736509 0.153363 0.869654 1.856194 1.010471 94.299357 62.171249 0.689666 0.704371 0.381535
122 N08 digital_ok 100.00% 2.16% 2.28% 0.00% 11.075749 9.937306 7.290796 1.078515 25.473480 23.277532 1.145080 -1.899411 0.695083 0.705701 0.384145
123 N08 digital_ok 100.00% 0.00% 0.00% 0.00% 9.073515 12.767772 1.447688 1.789909 -0.818740 0.304432 3.066508 5.141089 0.697185 0.705529 0.381287
124 N09 digital_ok 100.00% 100.00% 100.00% 0.00% -0.028986 4.363596 -0.052891 -0.230375 -0.025825 -0.213562 4.199449 2.855933 0.064494 0.070968 0.008724
125 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% 1.193731 4.433475 -0.255312 0.460378 -0.178359 2.923873 1.807316 7.051189 0.062287 0.068280 0.007438
126 N09 RF_maintenance 100.00% 100.00% 100.00% 0.00% 7.731678 -0.261945 3.687207 0.716090 13.530317 0.633320 17.956545 0.186915 0.072514 0.071139 0.014869
127 N10 digital_ok 100.00% 0.00% 0.06% 0.00% 0.302342 -0.462235 -0.729954 0.207172 2.534739 1.458672 4.349004 11.207150 0.686634 0.700484 0.396187
128 N10 digital_ok 100.00% 0.00% 0.00% 0.00% -0.431872 0.552651 6.241301 1.893511 0.187663 2.266769 3.196849 1.250488 0.680406 0.695162 0.387692
129 N10 digital_ok 0.00% 0.00% 0.06% 0.00% 0.525062 -1.614433 -0.717426 -0.305915 -0.596575 -0.713379 -0.657542 -0.789769 0.680565 0.695675 0.394739
130 N10 digital_ok 100.00% 0.00% 0.00% 0.00% 4.119302 0.754770 -0.249443 0.229235 0.111242 1.088417 7.810323 12.330613 0.658015 0.685970 0.392902
131 N11 not_connected 100.00% 100.00% 100.00% 0.00% 18.676618 21.006568 23.047001 24.921017 12.983070 17.768695 11.696218 1.322123 0.035246 0.041463 0.002740
132 N11 not_connected 100.00% 0.00% 0.00% 0.00% 6.243572 1.652688 38.532656 29.255572 7.932263 6.429448 -4.690518 -3.184590 0.635352 0.666802 0.414179
133 N11 not_connected 100.00% 100.00% 77.01% 0.00% 19.332085 26.687731 21.602861 16.174616 12.995969 17.590277 8.093066 3.907410 0.043505 0.181233 0.086905
135 N12 RF_maintenance 100.00% 0.00% 100.00% 0.00% -1.733956 19.300382 -0.427324 57.631424 0.325279 17.868457 2.150223 5.870016 0.632910 0.042056 0.402500
136 N12 digital_ok 100.00% 0.00% 0.00% 0.00% 6.411230 1.097219 0.633150 2.069566 0.807437 7.967584 2.038947 1.966877 0.623415 0.657497 0.400024
137 N07 RF_maintenance 100.00% 52.39% 52.39% 0.00% 1.589015 -0.846439 0.062345 -0.589016 23.577759 23.752108 3.247279 1.212944 0.355070 0.367475 0.185063
138 N07 RF_maintenance 100.00% 50.23% 50.18% 0.00% 2.198363 0.107043 3.365875 5.623075 0.153202 -0.379753 18.633714 0.908074 0.380059 0.381898 0.186715
139 N13 RF_maintenance 100.00% 0.06% 0.06% 0.00% 8.131506 5.236162 41.910290 36.376134 8.824704 9.275042 -5.435227 -3.362153 0.662450 0.686082 0.392939
140 N13 digital_ok 100.00% 0.06% 100.00% 0.00% 6.676597 20.393975 38.940988 56.838252 7.405910 17.789190 -0.117851 11.876282 0.671223 0.055733 0.470752
141 N13 digital_ok 100.00% 0.00% 0.06% 0.00% -0.936686 8.546613 2.155572 43.041968 0.997250 12.931909 4.448135 -6.625134 0.687503 0.685904 0.374972
142 N13 digital_ok 100.00% 0.00% 100.00% 0.00% 2.164688 19.105466 0.848735 57.284108 3.228404 17.851762 3.952933 8.549323 0.683803 0.049614 0.469893
143 N14 digital_ok 100.00% 100.00% 0.06% 0.00% 17.464424 -1.321786 56.620601 -0.258964 12.981819 1.438373 5.699491 1.368887 0.040536 0.705469 0.479427
144 N14 digital_ok 100.00% 0.06% 0.00% 0.00% -0.681166 -1.473763 0.003419 14.496115 0.791814 1.499021 1.214128 5.360370 0.687266 0.688538 0.391720
145 N14 RF_maintenance 100.00% 0.06% 0.06% 0.00% -1.676311 5.063778 0.196341 36.615952 10.215880 35.851191 1.538805 5.429845 0.682217 0.614427 0.415024
146 N14 digital_ok 100.00% 0.06% 0.06% 99.30% 4.882499 8.128382 32.719342 40.346606 5.251507 14.728808 -2.688598 -6.537677 0.275378 0.271351 -0.274901
147 N15 digital_ok 100.00% 0.00% 0.00% 0.00% -0.510154 -0.357208 5.894488 8.713009 6.563272 -0.788422 1.558820 0.754717 0.678397 0.689546 0.383421
148 N15 RF_maintenance 100.00% 0.00% 0.06% 0.00% 0.246107 -0.701051 16.845663 6.228194 0.525191 1.619940 1.425113 0.574670 0.664702 0.693378 0.394896
149 N15 RF_maintenance 100.00% 0.06% 0.00% 0.00% -1.115771 3.106158 11.544497 31.598042 -0.239903 6.474852 2.175748 -3.052063 0.678150 0.692958 0.395322
150 N15 RF_maintenance 100.00% 100.00% 0.06% 0.00% 18.247462 5.411235 56.006759 36.786173 13.023660 10.665071 10.550885 -4.722786 0.052528 0.286929 0.111116
155 N12 RF_maintenance 100.00% 99.94% 0.06% 0.00% 16.701553 -0.682023 54.105875 0.638579 12.972825 10.933220 5.522954 7.062659 0.065657 0.661095 0.463929
156 N12 RF_maintenance 100.00% 0.06% 0.00% 0.00% 11.498329 -0.646876 50.836302 2.249238 9.793555 -0.007233 6.021864 1.827073 0.375383 0.669326 0.485693
157 N12 digital_ok 0.00% 0.00% 0.00% 0.00% -0.354108 -0.514157 0.184290 -0.295394 -1.104862 -0.232924 -0.180831 -0.600093 0.649151 0.673447 0.406331
158 N12 digital_ok 100.00% 0.06% 0.00% 0.00% 0.691452 -0.400687 1.864798 4.626229 1.600686 1.642522 11.679782 52.344048 0.666551 0.687137 0.409444
159 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 3.378897 33.575487 29.777803 26.719556 4.486894 12.037950 -0.022793 47.203552 0.665191 0.552232 0.377025
160 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.744955 -0.464834 1.190846 5.532979 -0.834773 0.789898 3.212465 3.411165 0.678604 0.694346 0.384301
161 N13 digital_ok 100.00% 0.00% 0.00% 0.00% -0.412102 42.603494 -0.238208 7.560556 -0.628838 6.157500 0.970915 4.969524 0.681870 0.575000 0.347369
162 N13 digital_ok 100.00% 0.00% 0.00% 0.00% 1.015005 1.746098 9.314587 7.413775 6.333908 9.401059 4.073119 6.232774 0.694176 0.706310 0.384874
163 N14 digital_ok 0.00% 0.00% 0.00% 0.00% -0.671787 -1.417604 0.726259 -0.759482 -1.013594 1.085571 0.597832 1.905946 0.692154 0.700585 0.390202
164 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 0.143884 -0.509754 7.138821 3.308740 18.423106 1.817883 4.405234 4.727783 0.680064 0.705252 0.390843
165 N14 digital_ok 100.00% 0.06% 0.00% 0.00% 29.720429 -0.330948 41.300417 3.395395 9.545891 -0.394805 7.319309 0.759059 0.408686 0.701580 0.434849
166 N14 RF_maintenance 100.00% 0.06% 96.62% 0.00% 44.276779 17.898400 8.270941 54.682656 8.205830 17.761291 107.612835 5.982224 0.553648 0.098433 0.364991
167 N15 digital_ok 100.00% 0.06% 0.06% 0.00% -0.990654 -1.434762 13.208700 2.298474 0.919631 0.849886 0.063856 9.402441 0.693362 0.697059 0.393966
168 N15 RF_maintenance 0.00% 0.00% 0.06% 0.00% -1.418630 -1.215607 -0.951575 2.037514 0.750001 0.165642 0.299409 0.334741 0.682794 0.698673 0.394382
169 N15 digital_ok 100.00% 0.00% 0.12% 0.00% 3.149698 15.762305 28.712356 34.976725 3.019257 17.350269 -3.087730 6.216756 0.680860 0.608514 0.397439
170 N15 digital_ok 100.00% 100.00% 0.00% 0.00% 18.222529 0.036877 56.989712 9.049472 12.973161 27.909126 6.486565 3.322994 0.044402 0.691636 0.497431
179 N12 RF_maintenance 100.00% 100.00% 100.00% 0.00% 18.489696 20.952862 56.989989 60.103747 12.988621 17.928571 5.594494 6.445037 0.055364 0.052158 0.005719
180 N13 RF_maintenance 100.00% 100.00% 100.00% 0.00% 17.633879 20.205936 56.510570 57.999919 13.003818 17.934585 7.025730 11.381504 0.049818 0.053901 0.004193
181 N13 digital_ok 100.00% 0.00% 0.06% 0.00% -0.064319 -0.817845 0.688601 -0.619089 0.085499 3.330034 2.257593 16.070977 0.687960 0.696379 0.387686
182 N13 RF_maintenance 100.00% 0.00% 0.00% 0.00% 4.083891 7.274089 31.694051 39.863982 2.085814 11.245738 12.705455 -2.297967 0.634083 0.692511 0.399628
183 N13 digital_ok 100.00% 100.00% 0.00% 0.00% 17.808035 0.531775 55.239742 0.702528 13.133555 0.412946 4.826451 2.086012 0.046870 0.696193 0.436211
184 N14 digital_ok 100.00% 99.77% 100.00% 0.00% 17.157273 19.722024 56.281636 57.349785 12.943911 17.843635 9.043534 8.753717 0.112354 0.046983 0.047236
185 N14 digital_ok 100.00% 100.00% 0.06% 0.00% 16.386782 -0.603530 56.200954 16.535254 13.049212 0.135073 5.822344 1.178894 0.039401 0.685370 0.440602
186 N14 digital_ok 100.00% 0.00% 0.06% 0.00% 1.464540 2.077488 16.673410 11.717758 19.267235 0.169607 5.275890 1.765002 0.670858 0.705470 0.392931
187 N14 digital_ok 100.00% 0.00% 0.00% 0.00% 4.862280 2.929269 5.963779 28.483838 50.929216 6.492016 5.936681 8.860126 0.676944 0.700393 0.389697
189 N15 digital_ok 100.00% 0.06% 0.00% 0.00% 1.905446 2.651239 6.079383 2.926065 1.036796 2.479305 4.894022 16.040972 0.661018 0.685713 0.399452
190 N15 digital_ok 100.00% 0.12% 100.00% 0.00% 68.657629 19.413273 7.933034 57.786960 10.094382 19.786656 125.153987 18.780145 0.490264 0.038228 0.327072
191 N15 digital_ok 100.00% 0.00% 0.06% 0.00% 0.646805 1.498761 20.279954 0.858445 0.887572 -0.119234 49.326436 2.544599 0.633214 0.674427 0.428442
200 N18 RF_maintenance 100.00% 100.00% 40.43% 0.00% 19.596855 52.437706 22.689705 22.678444 13.127209 17.934498 9.983915 -0.956212 0.049898 0.224121 0.130827
201 N18 RF_maintenance 100.00% 0.06% 0.06% 0.00% 11.035207 10.219343 47.262296 45.531974 11.117455 14.707078 -8.333100 -8.117515 0.640538 0.658903 0.384409
202 N18 digital_ok 100.00% 0.06% 0.06% 0.00% 3.041106 5.019002 22.721319 2.571642 2.836485 4.938913 3.172880 10.641165 0.668955 0.645479 0.389012
203 N18 RF_maintenance 100.00% 100.00% 100.00% 0.00% 20.402397 22.001949 21.340612 22.316993 13.073250 17.824763 12.206775 12.806413 0.035051 0.044233 0.003202
205 N19 RF_ok 100.00% 0.00% 0.12% 0.00% 4.308127 7.778372 18.929651 6.608928 1.600706 5.609910 1.521302 14.626828 0.665735 0.607303 0.409146
206 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 2.765745 3.781575 18.024811 15.324460 33.935295 2.534822 3.068369 9.689661 0.656321 0.660294 0.380095
207 N19 RF_ok 100.00% 0.00% 0.00% 0.00% 5.229024 4.738527 26.695994 21.656211 3.921471 5.715744 -0.832170 -1.991882 0.647727 0.656699 0.371791
208 N20 dish_maintenance 100.00% 99.77% 99.94% 0.00% 211.197808 230.606502 inf inf 7135.713554 6905.485916 12883.025635 14085.578693 0.229141 0.173578 0.058658
209 N20 dish_maintenance 100.00% 99.82% 99.94% 0.00% 222.661281 215.087214 inf inf 7008.780806 6462.421590 13778.653482 16685.191740 0.216976 0.166148 0.060890
210 N20 dish_maintenance 100.00% 99.77% 99.94% 0.00% 275.944813 278.742177 inf inf 6809.899175 6574.762928 11464.788279 13597.229272 0.224787 0.182365 0.058314
211 N20 RF_ok 100.00% 99.88% 100.00% 0.00% 209.953310 199.388116 inf inf 6739.980884 7003.139924 10808.825406 11709.822228 0.199767 0.163391 0.051794
219 N18 RF_maintenance 100.00% 0.00% 0.06% 0.00% 10.467118 7.592323 47.287421 40.690634 11.337198 11.865703 -8.280650 -6.299368 0.612017 0.664616 0.408108
220 N18 RF_maintenance 100.00% 0.00% 0.00% 0.00% 6.410388 8.033451 39.429389 40.549723 7.821260 11.767363 -1.101823 -7.464561 0.664052 0.669877 0.397254
221 N18 RF_ok 100.00% 0.06% 0.06% 0.00% 4.850734 2.419848 2.542508 18.237001 3.585183 2.862554 9.502791 0.930654 0.628962 0.670022 0.399262
222 N18 RF_ok 100.00% 0.06% 0.06% 0.00% 7.834232 8.851666 41.209715 41.056622 8.717062 11.653290 -0.128474 -6.480069 0.656858 0.670470 0.393318
223 N19 RF_ok 100.00% 0.00% 0.06% 0.00% 5.050711 3.244288 9.749244 6.308941 1.976120 62.364188 3.315280 10.207158 0.637797 0.643813 0.381051
224 N19 RF_ok 100.00% 0.00% 0.06% 0.00% 11.118990 10.916571 48.320986 48.356296 11.401503 16.176414 -8.422040 -9.671815 0.644901 0.652448 0.386494
225 N19 RF_ok 100.00% 99.77% 99.88% 0.00% 293.289962 291.435332 inf inf 6659.062213 7071.299371 12036.579120 13128.832018 0.223072 0.194192 0.053489
226 N19 RF_ok 100.00% 99.77% 99.94% 0.00% 285.785423 285.932174 inf inf 6378.155241 6258.955916 13609.797153 13136.172255 0.231852 0.192323 0.056595
227 N20 RF_ok 100.00% 99.77% 99.88% 0.00% 239.875175 242.802456 inf inf 7179.899944 6933.844452 13903.982003 15124.697820 0.230776 0.195123 0.057307
228 N20 RF_maintenance 100.00% 99.82% 99.94% 0.00% 219.243575 239.684339 inf inf 7399.987652 7474.734572 11928.844813 14393.858351 0.210019 0.194852 0.046954
229 N20 RF_maintenance 100.00% 99.82% 99.94% 0.00% 257.449500 278.682664 inf inf 7171.271257 7201.865592 13218.326657 15260.614386 0.200433 0.171251 0.046406
237 N18 RF_ok 100.00% 0.06% 0.06% 0.00% 5.344313 3.674019 1.382350 13.883290 3.301551 3.659557 1.800881 -0.567313 0.609034 0.643896 0.406666
238 N18 RF_ok 100.00% 0.00% 0.06% 0.00% 1.898370 1.021521 25.455742 25.303848 3.039179 6.078209 -1.648428 -3.105342 0.660375 0.663978 0.404544
239 N18 RF_ok 100.00% 0.00% 0.06% 0.00% 1.371135 4.269024 17.067081 32.197548 4.229213 7.617119 4.526128 21.246754 0.654030 0.666411 0.399081
240 N19 RF_maintenance 100.00% 99.82% 99.94% 0.00% 326.988957 229.416602 inf inf 5670.268742 6358.665227 13883.752629 13620.035633 0.216479 0.175424 0.052693
241 N19 RF_ok 100.00% 0.00% 0.06% 0.00% 3.794912 6.996927 14.505672 0.018116 1.210820 3.894761 21.108501 64.019187 0.648189 0.613540 0.403876
242 N19 RF_ok 100.00% 0.06% 0.06% 0.00% 48.101505 3.971550 17.448748 28.271378 22.625462 4.777456 34.998992 -1.987543 0.487300 0.665963 0.415362
243 N19 RF_ok 100.00% 4.32% 0.06% 0.00% 87.211136 4.907123 18.114537 12.888271 12.006040 3.303606 -1.902566 3.050131 0.302540 0.644639 0.512593
244 N20 RF_maintenance 100.00% 99.94% 100.00% 0.00% 244.262463 228.760506 inf inf 6872.623012 7202.638150 10509.001575 11563.099254 0.184539 0.159198 0.039716
245 N20 RF_ok 100.00% 99.82% 100.00% 0.00% 309.717852 310.899990 inf inf 8937.397397 8825.943538 20253.094078 20748.974034 0.192616 0.164461 0.048532
246 N20 RF_maintenance 100.00% 99.88% 100.00% 0.00% 205.166872 199.279165 inf inf 7691.920603 7679.137073 15170.005429 14498.514545 0.192937 0.161277 0.049004
261 N20 RF_ok 100.00% 99.88% 99.94% 0.00% 245.534789 257.171264 inf inf 7856.595697 7834.171631 14093.243054 13784.197369 0.196782 0.172086 0.041497
262 N20 dish_maintenance 100.00% 99.88% 99.94% 0.00% 246.905638 243.142963 inf inf 6624.233971 6353.602775 13058.956995 15803.682102 0.200216 0.191114 0.043446
320 N03 dish_maintenance 100.00% 0.00% 100.00% 0.00% 1.605576 20.301821 1.072102 36.150626 0.359130 17.904179 46.468122 16.307077 0.653106 0.050596 0.471733
324 N04 not_connected 100.00% 0.06% 0.23% 0.00% 2.806123 5.106743 25.404590 29.894554 3.498935 5.592638 3.599619 -1.517935 0.555270 0.557916 0.395559
325 N09 dish_ok 100.00% 100.00% 100.00% 0.00% 1.431071 0.282550 25.956030 13.375705 3.416634 2.443534 -2.014739 0.669006 0.079149 0.081870 0.032012
329 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 6.064998 0.070366 0.171732 15.968589 1.844079 1.995295 18.983415 2.889534 0.510456 0.572514 0.410358
333 N12 dish_maintenance 100.00% 0.00% 0.00% 0.00% 5.508775 2.708329 4.043899 12.737412 1.755969 2.650350 6.012188 5.218646 0.523531 0.561553 0.401007
In [22]:
# print ex_ants for easy copy-pasting to YAML file
proposed_ex_ants = [ant for i, ant in enumerate(ants) if np.any([col[i] > 0 for col in bar_cols.values()])]
print('ex_ants: [' + ", ".join(str(ant) for ant in proposed_ex_ants) + ']')
print(f'\nunflagged_ants: [{", ".join([str(ant) for ant in ants if ant not in proposed_ex_ants])}]')
# "golden" means no flags and good a priori status
golden_ants = ", ".join([str(ant) for ant in ants if ((ant not in proposed_ex_ants) and (a_priori_statuses[ant] in good_statuses.split(',')))])
print(f'\ngolden_ants: [{golden_ants}]')
ex_ants: [3, 4, 5, 7, 8, 9, 10, 15, 16, 17, 18, 19, 20, 21, 22, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 155, 156, 158, 159, 160, 161, 162, 164, 165, 166, 167, 168, 169, 170, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 200, 201, 202, 203, 205, 206, 207, 208, 209, 210, 211, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 261, 262, 320, 324, 325, 329, 333]

unflagged_ants: [85, 112, 157, 163]

golden_ants: [85, 112, 157, 163]
In [23]:
# write to csv
outpath = os.path.join(nb_outdir, f'rtp_summary_table_{JD}.csv')
print(f'Now saving Table 2 to a csv at {outpath}')
df.to_csv(outpath)
Now saving Table 2 to a csv at /home/obs/src/H6C_Notebooks/_rtp_summary_/rtp_summary_table_2459878.csv
In [24]:
# Load antenna positions
data_list = sorted(glob.glob(os.path.join(data_path, f'zen.{JD}.?????.sum.uvh5')))
hd = io.HERAData(data_list[len(data_list) // 2])

# Figure out where to draw the nodes
node_centers = {}
for node in sorted(set(list(nodes.values()))):
    if np.isfinite(node):
        this_node_ants = [ant for ant in ants + unused_ants if nodes[ant] == node]
        if len(this_node_ants) == 1:
            # put the node label just to the west of the lone antenna 
            node_centers[node] = hd.antpos[ant][node] + np.array([-14.6 / 2, 0, 0])
        else:
            # put the node label between the two antennas closest to the node center
            node_centers[node] = np.mean([hd.antpos[ant] for ant in this_node_ants], axis=0)
            closest_two_pos = sorted([hd.antpos[ant] for ant in this_node_ants], 
                                     key=lambda pos: np.linalg.norm(pos - node_centers[node]))[0:2]
            node_centers[node] = np.mean(closest_two_pos, axis=0)
In [25]:
def Plot_Array(ants, unused_ants, outriggers):
    plt.figure(figsize=(16,16))
    
    plt.scatter(np.array([hd.antpos[ant][0] for ant in hd.data_ants if ant in ants]), 
                np.array([hd.antpos[ant][1] for ant in hd.data_ants if ant in ants]), c='w', s=0)

    # connect every antenna to their node
    for ant in ants:
        if nodes[ant] in node_centers:
            plt.plot([hd.antpos[ant][0], node_centers[nodes[ant]][0]], 
                     [hd.antpos[ant][1], node_centers[nodes[ant]][1]], 'k', zorder=0)

    rc_color = '#0000ff'
    antm_color = '#ffa500'
    autom_color = '#ff1493'

    # Plot 
    unflagged_ants = []
    for i, ant in enumerate(ants):
        ant_has_flag = False
        # plot large blue annuli for redcal flags
        if use_redcal:
            if redcal_flagged_frac[ant] > 0:
                ant_has_flag = True
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=7 * (2 - 1 * float(not outriggers)), fill=True, lw=0,
                                                color=rc_color, alpha=redcal_flagged_frac[ant]))
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=6 * (2 - 1 * float(not outriggers)), fill=True, color='w'))
        
        # plot medium green annuli for ant_metrics flags
        if use_ant_metrics: 
            if ant_metrics_xants_frac_by_ant[ant] > 0:
                ant_has_flag = True
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=6 * (2 - 1 * float(not outriggers)), fill=True, lw=0,
                                                color=antm_color, alpha=ant_metrics_xants_frac_by_ant[ant]))
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=5 * (2 - 1 * float(not outriggers)), fill=True, color='w'))
        
        # plot small red annuli for auto_metrics
        if use_auto_metrics:
            if ant in auto_ex_ants:
                ant_has_flag = True                
                plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=5 * (2 - 1 * float(not outriggers)), fill=True, lw=0, color=autom_color)) 
        
        # plot black/white circles with black outlines for antennas
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4 * (2 - 1 * float(not outriggers)), fill=True, color=['w', 'k'][ant_has_flag], ec='k'))
        if not ant_has_flag:
            unflagged_ants.append(ant)

        # label antennas, using apriori statuses if available
        try:
            bgc = matplotlib.colors.to_rgb(status_colors[a_priori_statuses[ant]])
            c = 'black' if (bgc[0]*0.299 + bgc[1]*0.587 + bgc[2]*0.114) > 186 / 256 else 'white'
        except:
            c = 'k'
            bgc='white'
        plt.text(hd.antpos[ant][0], hd.antpos[ant][1], str(ant), va='center', ha='center', color=c, backgroundcolor=bgc)

    # label nodes
    for node in sorted(set(list(nodes.values()))):
        if not np.isnan(node) and not np.all(np.isnan(node_centers[node])):
            plt.text(node_centers[node][0], node_centers[node][1], str(node), va='center', ha='center', bbox={'color': 'w', 'ec': 'k'})
    
    # build legend 
    legend_objs = []
    legend_labels = []
    
    # use circles for annuli 
    legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgecolor='k', markerfacecolor='w', markersize=13))
    legend_labels.append(f'{len(unflagged_ants)} / {len(ants)} Total {["Core", "Outrigger"][outriggers]} Antennas Never Flagged')
    legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markerfacecolor='k', markersize=15))
    legend_labels.append(f'{len(ants) - len(unflagged_ants)} Antennas {["Core", "Outrigger"][outriggers]} Flagged for Any Reason')

    if use_auto_metrics:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=autom_color, markersize=15))
        legend_labels.append(f'{len([ant for ant in auto_ex_ants if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas Flagged by Auto Metrics')
    if use_ant_metrics: 
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=antm_color, markersize=15))
        legend_labels.append(f'{np.round(np.sum([frac for ant, frac in ant_metrics_xants_frac_by_ant.items() if ant in ants]), 2)} Antenna-Nights on' 
                             f'\n{np.sum([frac > 0 for ant, frac in ant_metrics_xants_frac_by_ant.items() if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas '
                             'Flagged by Ant Metrics\n(alpha indicates fraction of time)')        
    if use_redcal:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markeredgewidth=2, markeredgecolor=rc_color, markersize=15))
        legend_labels.append(f'{np.round(np.sum(list(redcal_flagged_frac.values())), 2)} Antenna-Nights on' 
                             f'\n{np.sum([frac > 0 for ant, frac in redcal_flagged_frac.items() if ant in ants])} {["Core", "Outrigger"][outriggers]} Antennas '
                             'Flagged by Redcal\n(alpha indicates fraction of time)')

    # use rectangular patches for a priori statuses that appear in the array
    for aps in sorted(list(set(list(a_priori_statuses.values())))):
        if aps != 'Not Found':
            legend_objs.append(plt.Circle((0, 0), radius=7, fill=True, color=status_colors[aps]))
            legend_labels.append(f'A Priori Status:\n{aps} ({[status for ant, status in a_priori_statuses.items() if ant in ants].count(aps)} {["Core", "Outrigger"][outriggers]} Antennas)')

    # label nodes as a white box with black outline
    if len(node_centers) > 0:
        legend_objs.append(matplotlib.patches.Patch(facecolor='w', edgecolor='k'))
        legend_labels.append('Node Number')

    if len(unused_ants) > 0:
        legend_objs.append(matplotlib.lines.Line2D([0], [0], marker='o', color='w', markerfacecolor='grey', markersize=15, alpha=.2))
        legend_labels.append(f'Anntenna Not In Data')
        
    
    plt.legend(legend_objs, legend_labels, ncol=2, fontsize='large', framealpha=1)
    
    if outriggers:
        pass
    else:
        plt.xlim([-200, 150])
        plt.ylim([-150, 150])        
       
    # set axis equal and label everything
    plt.axis('equal')
    plt.tight_layout()
    plt.title(f'Summary of {["Core", "Outrigger"][outriggers]} Antenna Statuses and Metrics on {JD}', size=20)    
    plt.xlabel("Antenna East-West Position (meters)", size=12)
    plt.ylabel("Antenna North-South Position (meters)", size=12)
    plt.xticks(fontsize=12)
    plt.yticks(fontsize=12)
    xlim = plt.gca().get_xlim()
    ylim = plt.gca().get_ylim()    
        
    # plot unused antennas
    plt.autoscale(False)    
    for ant in unused_ants:
        if nodes[ant] in node_centers:
            plt.plot([hd.antpos[ant][0], node_centers[nodes[ant]][0]], 
                     [hd.antpos[ant][1], node_centers[nodes[ant]][1]], 'k', alpha=.2, zorder=0)
        
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4, fill=True, color='w', ec=None, alpha=1, zorder=0))
        plt.gca().add_artist(plt.Circle(tuple(hd.antpos[ant][0:2]), radius=4, fill=True, color='grey', ec=None, alpha=.2, zorder=0))
        if hd.antpos[ant][0] < xlim[1] and hd.antpos[ant][0] > xlim[0]:
            if hd.antpos[ant][1] < ylim[1] and hd.antpos[ant][1] > ylim[0]:
                plt.text(hd.antpos[ant][0], hd.antpos[ant][1], str(ant), va='center', ha='center', color='k', alpha=.2) 

Figure 1: Array Plot of Flags and A Priori Statuses¶

This plot shows all antennas, which nodes they are connected to, and their a priori statuses (as the highlight text of their antenna numbers). It may also show (depending on what is finished running):

  • Whether they were flagged by auto_metrics (red circle) for bandpass shape, overall power, temporal variability, or temporal discontinuities. This is done in a binary fashion for the whole night.
  • Whether they were flagged by ant_metrics (green circle) as either dead (on either polarization) or crossed, with the transparency indicating the fraction of the night (i.e. number of files) that were flagged.
  • Whether they were flagged by redcal (blue circle) for high chi^2, with the transparency indicating the fraction of the night (i.e. number of files) that were flagged.

Note that the last fraction does not include antennas that were flagged before going into redcal due to their a priori status, for example.

In [26]:
core_ants = [ant for ant in ants if ant < 320]
outrigger_ants = [ant for ant in ants if ant >= 320]
Plot_Array(ants=core_ants, unused_ants=unused_ants, outriggers=False)
if len(outrigger_ants) > 0:
    Plot_Array(ants=outrigger_ants, unused_ants=sorted(set(unused_ants + core_ants)), outriggers=True)

Metadata¶

In [27]:
from hera_qm import __version__
print(__version__)
from hera_cal import __version__
print(__version__)
2.0.4.dev44+g3962204
3.1.5.dev171+gc8e6162
In [ ]: